package com.chevic.app;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import com.chevic.util.DBUtil;
import com.chevic.util.Util;


public class UserLog {
	
	public void saveUser(HttpServletRequest req) throws Exception{
		String name = req.getParameter("userName") ;
		String tel = req.getParameter("telNum") ;
		Date date = new Date() ;
		
		Connection conn = DBUtil.getConnW() ;
		PreparedStatement ps = conn.prepareStatement("insert into user (name,tel,logtime,doflag) values(?,?,?,'0')") ;
		ps.setString(1, name) ;
		ps.setString(2, tel.substring(0,11)) ;
		ps.setString(3, Util.getCurrentTime()) ;
		
		ps.execute() ;
		ps.close() ;
		conn.close() ;
	}
	
	

}
